import request from '@/api/myRequest'

function getAllCategory() {
  return request({
    url: '/lejuAdmin/category/getAllCategory',
    method: 'get'
  })
}

// 添加分类
function addCategory(data) {
  return request({
    url: '/lejuAdmin/category/addCategory',
    method: 'post',
    data
  })
}

// 删除分类
function delCategory(id) {
  return request({
    url: `/lejuAdmin/category/delCategory/${id}`,
    method: 'delete'
  })
}

// 更新分类
function updateCategory(data) {
  return request({
    url: '/lejuAdmin/category/updateCategory',
    method: 'post',
    data
  })
}

export { getAllCategory, addCategory, delCategory, updateCategory }
